﻿#include<stdio.h>
void inverted(int* nums,int left,int right)
{
	while (left < right)
	{
		int tmp = nums[left];
		nums[left] = nums[right];
		nums[right] = tmp;
		left++;
		right--;
	}
}
void rotate(int* nums, int k, int numsize)
{
	inverted(nums,0,numsize - k-1);
	inverted(nums,numsize-k, numsize-1);
	inverted(nums,0, numsize-1);
}
int main()
{
	int k = 3;
	int nums[] = {1, 2, 3, 4, 5, 6, 7};
	int numsize = sizeof(nums) / sizeof(nums[0]);
	rotate(nums,k,numsize);
	int i = 0;
	while (numsize--)
	{
		printf("%d", nums[i]);
		i++;
	}
	return 0;
}